package com.aiti.lulian.pay.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliPayConfig {

    @Bean
    public AlipayClient alipayClient(){
//        AlipayClient alipayClient = new DefaultAlipayClient(
//                "https://openapi-sandbox.dl.alipaydev.com/gateway.do",
//                "9021000131698561",
//                "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCRr/gByEu/8LVzPI5pFduTKkemKWX2HKQGjnl3DqBzMTW0yAsbYwZJPr5uPmpsKaFzocRwKau+fBx4lHaQapn3m6k9vtg+HPiBcNsGTK2rKWrFfbyA6Fh2baczJvIGtTiVbhCtDJMXBrMFJ7EfMLurS4oLZMblZBFagXP0w5Yvb44/ebdqszA/jsbeb3LKX6grFFhR1Pa2Cs4b2Xj9ucHgTILyCBcfsTcuPcA2vsi8XshSvpTD340Re7/EJSo99DVz0UhgXeFymor2sYfv6CzEMstfR4yC06HLOXOZIG6MCjqo0gttn7sIYEEzV3A6YTqLgFqX/tl2L1PLqbGCIjuhAgMBAAECggEAItvI6pxDS7TLpbwKkyhQtoC6Tg6/v8iQkqUKeSs9xvIyWIQ47B+ghGwH4pb6ndDEOceuGexOlLBbm5piWCG5n15We1irowkJiOc48OPt9fNeAc0ZCnsNl6CbDgk2hdZcqJyCTvWgSDUpJoWdwsnFTbIwYJOHZ6Gu6UnqNdmKmOSpnRreyOrV7nOSwVoqNr+35diJnjqiorHBFCwqF+wrU0p0WbVCkGn22cb2AoNgBGclLVediKcwPbLjGs2m0+jvQBwDfuZA0wYzu0jxKQfolo+SuTGpDTdihyigIWKPHRLiu5eKVF8ScGe3/H0/6BdRlK+jjV+BSOxubUozCCkUFQKBgQDkRfMIV7hZKfAryCYGvcMlrVRsxp8Eld/wkt2ZK/HSEi/ieCXkt1qBYA7tbNz1ecYCV13N29wEpT7oce9YxLv0KbrlM+VQNXrLNd4QQ/DWtLG3qHYOwef99T42E5Ec1Jfza0EozIIiif2VZhAjAEWyQR73jAaFXO0bnZ9d5J3jQwKBgQCjYgzhlrM5BDEoBrat6F6w3NrZfdoy4ixWn1iIjuyAdTDDFV+4GjJARB8Oc1Wc/3KHk/WeVUS9FzZhITBSlSgS6HC9NdAw1QxwocfBPB59rMPX93YD96tF0yeTXGiJvD8Aycf4ADiqm3E18dwvBO6HQxAhjHePAqcKOmejS0zNSwKBgBGTaTD9QA5tcjaMxJDET6A5BkURzfCWcZWeWT2P6qCYEePICHLhwzAu6zdQqHqmE57ehzRwdzJMXtma3CjjjO0xwVggdMmGNJws25o5APQnGX/gkqZ0O56MIWwceZHUtJZjbbLsfCCYq1Ozdg6b2MHuzamVuHLQQtlbe4fJMHbtAoGAfZbcQfg+kiBnzNXETNAnIZrTW4XDWYPEA13/hxEeOOxcbEkcx/7TC9WRbeE4OTOfDRquHmR7L0MNmQITDBf9svMb3kXkX/UU1+t0ClS1N3O7I2LkQ854yHa0oDDTZrTeVTPGVBuPc42DK61bzITk+fKSDsfUC4lFb7ZPfhVe1xsCgYEA4af+AtYGXxpUsSDn83TinG0ZtrKzBWfkdN2Rl7//kKxrEgPeaB6hCk4we/SaQw3dYTyizryjlvtKTR2of/bWYahbFG8OkkhQjaUaDsovmB+yzE7BZdnHevxnYaun3TLjWaETuvKMAZlq0G3OcXDP+1XEMQGuUbmnbMMymYRSTlE=",
//                "json",
//                "UTF-8",
//                "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxQJtzptli+xSMA34dmyPZPlWwpaSjK1AFJHzxLY7Eca2tICa7ndK6PqIjpP7EQun9MDLCXYxyYdTXpCluxMXZrwaICMBkt/3bQiP5uqJKnTphqCc++aXEAztFGgIPQ0vXlBRUP83RgjYrDiKtd4CTiYiGE/Ew6h37bBbB2zYXv6wUlpvXSI325Qvfk7ezLFKIBYbEoUN3oFXNMEAebDZZWeIK4KB1hNYyIPAXiB6+g0ctUvwclruM9xHh1zJdQYx/72DSRLdGH4IGZFHZnzRoNf3E+MGHqBi/NLpPh7+DqY+Tl0c6zzd5vEZd5e8XFoR8IglTQQ++TiGLqBscZshcQIDAQAB",
//                "RSA2","egGjIx0VSUS3MpDTaxhHzw==","AES");
        AlipayClient alipayClient = new DefaultAlipayClient(
                AliPayProperties.gatewayUrl,
                AliPayProperties.appId,
                AliPayProperties.appPrivateKey,
                "json",
                "UTF-8",
                AliPayProperties.aliPublicKey,
                "RSA2","egGjIx0VSUS3MpDTaxhHzw==","AES");
        return alipayClient;
    }

}
